import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';

import { Observable, Subject } from 'rxjs';

const httpOption = {
  headers: new HttpHeaders({ 'Content-Type': 'application/json' })
};

@Injectable({
  providedIn: 'root'
})
export class RepairService {
  constructor(
    private http: HttpClient,
  ) { }

  public closepanel = new Subject<boolean>();

  closePanelObservable = this.closepanel.asObservable();

  closePanel(e) {
    this.closepanel.next(e);
  }


  // 按类型获取管线长度
  public getPipeLengthByType() {
    return this.http.get<any>("");
    // return this.dataRxInquireService.get('pipestatist', 'pipe.type.length', null, null);
  }
  // 按孔径获取管线长度
  public getPipeLengthByCircle() {
    return this.http.get<any>("");
    // return this.dataRxInquireService.get('pipestatist', 'pipe.circle.length', null, null);
  }
  // 按材质获取管线长度
  public getPipeLengthByMaterial() {
    return this.http.get<any>("");
    // return this.dataRxInquireService.get('pipestatist', 'pipe.material.length', null, null);
  }
  // 按类型获取管点长度
  public getPipePointByType() {
    return this.http.get<any>("");
    // return this.dataRxInquireService.get('pipestatist', 'pipe.type.point.length', null, null);
  }
  // 按埋深获取管点长度
  public getPipePointByDepth() {
    return this.http.get<any>("");
    // return this.dataRxInquireService.get('pipestatist', 'pipe.depth.length', null, null);
  }
  // 按高程获取管点长度
  public getPipePointByHighLevel() {
    return this.http.get<any>("");
    // return this.dataRxInquireService.get('pipestatist', 'pipe.highlevel.length', null, null);
  }
  // 获取轨迹
  public getTrackLine() {
    return this.http.get<any>("");
    // return this.dataRxInquireService.get('pipestatist', 'track.line.geo', null, null);
  }
  // 按材质统计查询
  public getDetailByMaterial(body) {
    return this.http.post<any>("", body);
    // return this.dataRxInquireService.post('pipestatist', 'statis.material.query', body, null);
  }
  // 按类型查询图层列表
  public getLayerListByType(params) {
    return this.http.get<any>("", { params });
    // return this.dataRxInquireService.get('pipestatist', 'statis.layerlist.type', null, queryparam);
  }
  // 按埋深统计查询
  public getDetailByDepth(body) {
    return this.http.post<any>("", body);
    // return this.dataRxInquireService.post('pipestatist', 'statis.layerlist.depth', body, null);
  }
  // 按管点统计查询
  public getDetailByPipePoint(body) {
    return this.http.post<any>("", body);
    // return this.dataRxInquireService.post('pipestatist', 'statis.layerlist.point', body, null);
  }
  // 按管线统计查询
  public getDetailByPipeLine(body) {
    return this.http.post<any>("", body);
    // return this.dataRxInquireService.post('pipestatist', 'statis.layerlist.line', body, null);
  }
  // 按坡度统计查询
  public getDetailBySlope(body) {
    return this.http.post<any>("", body);
    // return this.dataRxInquireService.post('pipestatist', 'statis.layerlist.slope', body, null);
  }
  // 按管径统计查询
  public getDetailByDiameters(body) {
    return this.http.post<any>("", body);
    // return this.dataRxInquireService.post('pipestatist', 'statis.layerlist.diameters', body, null);
  }
  // 空间信息查询
  public queryGeometry(body) {
    return this.http.post<any>("", body);
    // return this.dataRxInquireService.post('pipestatist', 'query.geometry', body, null);
  }

}
